home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Shareware / Comunicatii / feedaemon / fd110rc5.exe / {app} / Data / defaults / styles / Forum.fdxsl < prev    next >
Extensible Markup Language  |  2004-05-28  |  4KB  |  126 lines

  1. <?xml version="1.0"?>
  2.  
  3. <xsl:stylesheet version="1.0"
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/">
  6. <xsl:output method="html"/>
  7.  
  8. <xsl:variable name="common-styles">
  9.     <style type="text/css">
  10.         body {
  11.             font-size: x-small;
  12.             font-family: Tahoma, Arial, sans-serif;
  13.             margin: 0;
  14.             margin-bottom: 12px;
  15.             color: WindowText;
  16.             background-color: Window;
  17.         }
  18.         div.channeltitle {
  19.             font-size: larger;
  20.             font-weight: bold;
  21.             margin: 10px 0;
  22.             text-align: center;
  23.         }        
  24.         div.heading {
  25.             background-color: ThreedFace;
  26.             color: ButtonText;
  27.             border-top: 1px solid ThreedShadow;
  28.             border-bottom: 1px solid ThreedShadow;
  29.             padding: 8px 10px;
  30.             width: 100%;
  31.         }
  32.         div.newsitemicons { float: right; top: 0; }
  33.         div.newsitemcontent { font-family: "Courier New", monospace; margin: 10px 16px; }
  34.         div.newsitemcontent code { font-size: 100%; background-color: ThreedLightShadow; }
  35.         a { color: #004FC1; }
  36.         a:hover { color: red; }
  37.         span.nodescription { color: GrayText; }
  38.     </style>
  39. </xsl:variable>
  40.  
  41. <!-- channel group -->
  42. <xsl:template match="newspaper[@type='group']">
  43.     <html>
  44.     <head>
  45.         <title>Group Newspaper</title>
  46.         <xsl:copy-of select="$common-styles"/>
  47.         <style type="text/css">
  48.             body { background-color: ThreedLightShadow;}
  49.             div.channelnewsitems {
  50.                 margin: 0 6px;
  51.                 border: 1px solid ThreedShadow;
  52.                 border-top: none;
  53.                 background-color: Window;
  54.             }
  55.         </style>
  56.     </head>
  57.     <body>
  58.     <xsl:for-each select="channel">
  59.         <div class="channeltitle">
  60.             <xsl:value-of select="title"/>
  61.         </div>
  62.         <div class="channelnewsitems">
  63.             <xsl:for-each select="item">    
  64.                 <xsl:sort select="fd:sortKey" data-type="number" order="ascending"/>
  65.                 <xsl:apply-templates select="."/>
  66.             </xsl:for-each>
  67.         </div>
  68.     </xsl:for-each>
  69.     </body>
  70.     </html>
  71. </xsl:template>
  72.  
  73. <!-- news item and channel -->
  74. <xsl:template match="newspaper[@type='newsitem' or @type='channel']">
  75.     <html>
  76.     <head>
  77.         <title>Newspaper</title>
  78.         <xsl:copy-of select="$common-styles"/>
  79.         <xsl:if test="@type='newsitem'">
  80.             <style type="text/css">
  81.                 div.heading { border-top: none;}
  82.             </style>
  83.         </xsl:if>
  84.     </head>
  85.     <body>
  86.     <xsl:for-each select="channel/item">
  87.         <xsl:sort select="fd:sortKey" data-type="number" order="ascending"/>
  88.         <xsl:apply-templates select="."/>
  89.     </xsl:for-each>    
  90.     </body>
  91.     </html>
  92. </xsl:template>
  93.  
  94. <!-- news item template -->
  95. <xsl:template match="item">
  96.     <div class="heading">                
  97.         <div class="newsitemicons">
  98.             <!-- add link to comments and enclosure if available -->
  99.             <xsl:if test="comments">
  100.                 <xsl:variable name="commentlink" select="comments"/>
  101.                 <xsl:variable name="commentimg" select="'$IMAGEDIR$comments.gif'"/>
  102.                 <a href="{$commentlink}"><img src="{$commentimg}" border="0" /></a>
  103.             </xsl:if>
  104.             <xsl:if test="enclosure">
  105.                 <xsl:variable name="enclosurelink" select="enclosure/@url"/>
  106.                 <xsl:variable name="enclosureimg" select="'$IMAGEDIR$enclosure.gif'"/>
  107.                 <a href="{$enclosurelink}"><img src="{$enclosureimg}" border="0" /></a>
  108.             </xsl:if>                
  109.         </div>        
  110.         <xsl:if test="author">
  111.             <strong>From: </strong><xsl:value-of select="author"/> 
  112.         </xsl:if>                    
  113.         <xsl:variable name="srclink" select="source/@htmlUrl"/>
  114.         <strong>To: </strong><a href="{$srclink}"><xsl:value-of select="source"/></a>
  115.         <br />
  116.         <xsl:variable name="itemlink" select="link"/>
  117.         <strong>Subject: </strong><a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="no"/></a>
  118.         <br />
  119.         <strong><xsl:value-of select="fd:dateDisplay"/></strong>
  120.     </div>
  121.     <div class="newsitemcontent">
  122.         <xsl:value-of select="description" disable-output-escaping="yes"/>
  123.     </div>
  124. </xsl:template>
  125.  
  126. </xsl:stylesheet>